<%--
  Created by IntelliJ IDEA.
  User: Administrator
  Date: 2020/3/13 0013
  Time: 18:45
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>登录成功页面</title>
    <style type="text/css">
        #mian-top{
            width: 100%;
            height: 90px;
            background:url("img/main-top-bg.png") no-repeat right center #2d62a3;
            border-bottom: 1px #245086 solid;
        }
        .grid{
            width: 96%;
            margin: 0px auto;
            position: relative;
            font-size: 13px;
        }
        #main-top .logo {
            font-size: 22px;
            color: #fff;
            float: left;
            line-height: 90px;
            text-decoration: none;
        }
        #main-top .personal-list .personal-name {
            margin-top: 35px;
            color: #fff;
            float: left;
        }
        #main-top .personal-list .pic {
            float: left;
            position: relative;
            text-align: center;
            overflow: hidden;
            width: 50px;
            height: 90px;
        }
        #main-top .personal-list .pic .mask {
            background: url(img/bg_blue.png) no-repeat center;
            width: 50px;
            height: 90px;
            position: absolute;
            left: 0px;
        }
        #main-top .personal-list .personal-name {
            margin-top: 35px;
            color: #fff;
            float: left;
        }
        #main-top .right-menu table {
            float: right;
            margin-top: 30px;
        }
        #right-menu{
            float: right;
        }
        form {
            padding: 0px;
            margin: 0px;
        }
        .login-out{
            float: right;
            color: #fff;
            margin-left: 20px;
            margin-top: 35px;
        }
        .logout{
            display: inline-block;
            font: normal normal normal 14px/1 FontAwesome;
            font-size: inherit;
            text-rendering: auto;
            -webkit-font-smoothing: antialiased;
        }
        .logout:before {
            content: "\f011";
        }
        .top-nav{
            border-top: 1px #346fb8 solid;
            background: #2d62a3;
            width: 100%;
            padding: 0px 15px;
            height: 50px;
        }
        ul, ol {
            margin-top: 0;
            margin-bottom: 10px;
        }
        .top-nav >li {
            float: left;
            position: relative;
            height: 30px;
            z-index: 1000;
            line-height: 50px;
        }
        .top-nav >li >a {
            color: #fff;
            padding: 0px 25px;
            font-weight: bold;
            float: left;
            height: 49px;
            line-height: 49px;
            text-decoration: none;
        }
        .top-nav >li .second-ul >li {
            position: relative;
            height: 40px;
            line-height: 40px;
            padding: 0px 15px;
            border-bottom: 1px #ddd solid;
        }
        .top-nav >li .second-ul-right {
            position: absolute;
            top: 39px;
        }
        .top-nav >li .second-ul {
            display: none;
            background: #fff;
            width: 200px;
            box-shadow: 0 0 10px rgba(0, 0, 0, 0.3);
        }
        ul ul, ol ul, ul ol, ol ol {
            margin-bottom: 0;
        }
        a:link {
            color: #000080;
            text-decoration: none;
        }
        a {
            color: #337ab7;
            text-decoration: none;
            background-color: transparent;
        }
        a:visited {
            text-decoration: none;
        }
        li {
            display: list-item;
            text-align: -webkit-match-parent;
            list-style: none;
        }
        body {
            font-size: 15px;
            font-family: "\u5fae\u8f6f\u96c5\u9ed1";
            line-height: 25px;
            background: #f6f8fb;
            color: #2f3749;
            min-width: 1260px;
        }
        .fa-map-marker:before {
            content: "\f041";
        }
        *:before, *:after {
            -webkit-box-sizing: border-box;
            -moz-box-sizing: border-box;
            box-sizing: border-box;
        }
        #current-bar span {
            color: #2d62a3;
        }
        #personal-info {
            background: #fff;
            padding: 20px;
            box-shadow: 3px 3px 3px #eee;
            animation: mymove 0.5s 1;
            -webkit-animation: mymove 0.5s 1;
            position: relative;
        }#personal-info .pic {
             position: relative;
             float: left;
             width: 70px;
             height: 70px;
             overflow: hidden;
             margin-right: 20px;
             text-align: center;
         }
        #personal-info .text {
            float: left;
        }
        #personal-info .text span {
            color: #f0f3f5;
        }
        #personal-info .text-2 {
            float: right;
        }#personal-info .info-box {
             display: inline-block;
             width: 240px;
             padding-top: 5px;
         }
        .date-icon {
            float: left;
            background: url(img/date-icon.png) no-repeat center #f0b824;
            width: 60px;
            height: 60px;
            border-radius: 50%;
            margin-top: 3px;
        }
        #personal-info .info-box div {
            float: left;
            padding-left: 20px;
            padding-top: 5px;
        }
        #personal-info .info-box div span {
            font-size: 36px;
        }
        #personal-info .info-box div i {
            font-size: 18px;
            font-style: normal;
        }
        #personal-info .info-box div strong {
            font-size: 16px;
            font-weight: normal;
        }
        #personal-info .info-box {
            display: inline-block;
            width: 240px;
            padding-top: 5px;
        }
        .computer-icon {
            float: left;
            background: url(img/computer-icon.png) no-repeat center #64b524;
            width: 60px;
            height: 60px;
            border-radius: 50%;
            margin-top: 3px;
        }
        .row {
            margin-right: -15px;
            margin-left: -15px;
        }
        .col-md-3, .col-md-6 {
            position: relative;
            min-height: 1px;
            padding-right: 15px;
            padding-left: 15px;
            float: left;
        }
        .list-box-1 {
            background: #fff;
            box-shadow: 3px 3px 3px #eee;
            -webkit-animation: mymove 0.5s 1;
            position: relative;
        }
        .list-box-1 .title {
            height: 40px;
            line-height: 40px;
            margin: 0px;
            border-bottom: 1px #eee solid;
            padding: 0px 20px;
        }
        .fa {
            display: inline-block;
            font: normal normal normal 14px/1 FontAwesome;
            font-size: inherit;
            text-rendering: auto;
            -webkit-font-smoothing: antialiased;
        }
        .jrkc-box {
            height: 300px;
            padding: 10px;
            overflow-y: scroll;
        }
        .jrkc-box table {
            margin-top: 10px;
        }
        .clear-1 {
            clear: both;
            height: 10px;
            line-height: 10px;
            font-size: 1px;
        }
        .clear-2 {
            clear: both;
            height: 20px;
            line-height: 20px;
            font-size: 1px;
        }
        .list-box-1 {
            background: #fff;
            box-shadow: 3px 3px 3px #eee;
            animation: mymove 0.5s 1;
            -webkit-animation: mymove 0.5s 1;
            position: relative;
        }
        .list-box-1 .title {
            height: 40px;
            line-height: 40px;
            margin: 0px;
            border-bottom: 1px #eee solid;
            padding: 0px 20px;
        }
        .list-box-1 .content {
            padding: 10px 20px;
        }
        .list-box-1 .content h5 {
            margin: 0px;
            font-size: 15px;
        }
        table {
            border-spacing: 0;
            border-collapse: collapse;
            background-color: transparent;
        }
        .list-box-1 .content {
            padding: 10px 20px;
        }
        .c_939aaa {
            color: #939aaa;
        }
        tr {
            display: table-row;
            vertical-align: inherit;
            border-color: inherit;
        }
        td {
            display: table-cell;
            vertical-align: inherit;
        }
        .list-box-1 .title a {
            float: right;
            color: #006abf;
            font-size: 14px;
        }
        .scroll-list-1 #carousel-example-generic {
            height: 280px;
        }
        .carousel {
            position: relative;
        }
        .carousel-inner {
            position: relative;
            width: 100%;
            overflow: hidden;
        }
        .carousel-inner > .item.next.left, .carousel-inner > .item.prev.right, .carousel-inner > .item.active {
            left: 0;
            -webkit-transform: translate3d(0, 0, 0);
            transform: translate3d(0, 0, 0);
        }
        .carousel-inner > .item {
            position: relative;
            display: none;
            -o-transition: .6s ease-in-out left;
        }
        .clear-3 {
            clear: both;
            height: 30px;
            line-height: 30px;
            font-size: 1px;
        }
        #footer {
            height: 50px;
            line-height: 50px;
            text-align: center;
            background: #444545;
            color: #fff;
            font-size: 14px;
        }
        .col-md-3 {
            width: 25%;
        }
        .col-md-6 {
            width: 50%;
        }
        #date{
            float: right;
        }
        .col-md-4{
            float: right;
        }
        .fa-paper-plane:before {
            content: "\f1d8";
        }
        .fa-list-ul:before {
            content: "\f0ca";
        }
        .fa-user:before {
            content: "\f007";
        }
        .fa-download:before {
            content: "\f019";
        }

        #gonggao{
            position: relative;
            right: 330px;
        }
        h2{
            font-size: 18px;
        }
        #logout{
            color: white;
            position: relative;
            bottom: 40px;
            right: 40px;
        }
        .my{
            color: white;
            position: relative;
            bottom: 65px;
            right: 140px;
            font-size: 10px;
        }
        #student{
            color: white;
            position: relative;
            bottom: 90px;
            right: 240px;
        }
        #tui{
            color: white;
        }
        img {
            vertical-align: middle;
            border: 0;
        }
        #education{
            color: white;
            font-size: 23px;
            position: relative;
            top: 23px;
        }
        #logo{
            position: relative;
            top: 23px;
        }

        .xwtr{
            border: 2px solid  deepskyblue;
        }
        .addnews{
            width: 500px;
            height: 250px;
            position: relative;
            left: 1300px;
            bottom: 250px;
            background: orange;

        }
    </style>
</head>
<body>
<script type="text/javascript" src="js/jquery-3.4.1.min(1).js"></script>
<script src="/js/mycopy.js"></script>
<%
    if(session.getAttribute("flag")==null){
        response.sendRedirect("login.jsp");
    }
%>
<div id="mian-top">
    <div class="grid">
        <a href="http://www.hbcszyxy.edu.cn/" target="iframeMain" onclick="returnopenUrl(this,'首页')" class="logo">
            <img src="img/logo1.png" id="logo"> &nbsp; &nbsp;
            <img src="img/logo-line.png"> &nbsp; &nbsp;
            <span id="education">教学管理系统</span>
        </a>
    </div>
    <div id="right-menu">
        <div id="logout">
            <a href="/exit" class="login-out">
                <span id="tui" > 退出</span>
            </a>

            <span id="copy" onclick="resizeIframe()">返回</span>
        </div>
        <div class="personal-list">
            <div class="pic">
                <div class="mask"></div>
                <a href="" target="iframeMain" onclick="return openUrl(this, '我的账户')" class="personal-name">
                    <span class="my">${sname}</span>
                </a>
            </div>
        </div>
        <table>
            <tr>
                <form id="form4460356481" name="form4460356481" action="" method="post"></form>
                <td>
                    <span style="padding:0 2px;color:#FFF;font-weight:bold;" id="student">学生</span>
                </td>
                <td>
                    <input type="hidden" name="security.userCategoryId" value="1" style="width:70px">
                </td>
            </tr>
        </table>
    </div>
</div>







<div id="main-nav">
    <ul class="top-nav">
        <li class="caidan">
            <a href="http://www.hbcszyxy.edu.cn/" target="iframeMain" onclick="return openUrl(this)" style="outline: none">首页</a>
        </li>

    </ul>
</div>

<div >
    <div id="main-content">
        <div class="grid-2">
            <div id="current-bar">
                <span class="fa fa-map-marker"></span> 您当前位置：<span>首页</span>
            </div>
        </div>
        <html  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" dir="ltr">
        <body style="">

        <div id="personal-info">
            <div class="pic">
                <div class="mask"></div>
                <img src="/eams/avatar/my.action">
            </div>
            <div class="text">
                <h2>您好，${sname}</h2> 学生&nbsp;&nbsp;
                <span>|</span>&nbsp;&nbsp;
                <a href="/eams/security/my.action">我的账户</a>
                <a style="color: red;" href="/eams/systemMessage.action?type=INBOX" title="点击查看消息详情">
                    （未读消息1条）
                </a>
            </div>
            <div class="text-2">
                <div class="info-box">

                    <a href="javascript:viewSemesterInfo(42);">
                        <span class="date-icon" title="点这里可以查看校历哦~"></span>
                    </a>

                    <div>
                        <span>5</span>
                        <i>/21</i>
                        <br>
                        <strong>当前教学周</strong>
                    </div>
                </div>
                <div class="info-box">
                    <span class="computer-icon"></span>
                    <div>
                        <!--访问次数-->
                        <span>${cs}</span>
                        <i>次</i>
                        <br>
                        <strong>系统访问次数</strong>
                    </div>
                </div>
            </div>
            <div class="clearfix"></div>
        </div>
        <div class="clear-2"></div>
        <div class="row">
            <div class="col-md-3">

                <div class="list-box-1" style="height:340px;">
                    <h2 class="title"><span class="fa fa-list-ul"></span> 今日课程 (<span>0</span>)</h2>
                    <div class="clearfix"></div>
                    <div class="jrkc-box">
                        <table>
                            <tbody>
                            </tbody>
                        </table>
                    </div>
                </div>
                <div class="clear-2"></div>
                <div class="list-box-1" style="height:215px;">
                    <h2 class="title"><span class="fa fa-user"></span> 登录信息 </h2>
                    <div class="clear-1"></div>
                    <div class="content">
                        <h5>最近登录</h5>
                        <div class="clear-2"></div>
                        <table>
                            <tbody>
                            <tr>
                                <td width="35%"> 时间：</td>
                                <td class="c_939aaa"><span id="curTime">${sj}</span></td>
                            </tr>
                            <tr>
                                <td>IP：</td>
                                <td class="c_939aaa">${ip}</td>
                            </tr>
                            <tr>
                                <td>登录设备： </td>
                                <td class="c_939aaa">${ie}</td>
                            </tr>
                            </tbody>
                        </table>
                    </div>
                    <div class="clearfix"></div>
                </div>
            </div>
            <div class="col-md-6">
                <div class="list-box-1" style="height:340px;">
                    <h2 class="title"><span class="fa fa-paper-plane"></span> 快捷入口 <a href="javascript:void(0);" onclick="quickConfig()"><span class="fa fa-cog" style="margin-top:10px"></span></a></h2>
                    <div class="clear-1"></div>
                    <div class="content">
                        <div class="scroll-list-1">
                            <div id="carousel-example-generic" class="carousel slide">
                                <div class="carousel-inner" role="listbox">
                                    <div class="item active">
                                        <div class="inner-list-2">
                                        </div>
                                    </div>
                                    <div class="item">
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="clearfix"></div>
                </div>
                <div class="clear-2"></div>
                <div class="list-box-1" style="height:215px;">
                    <h2 class="title"><span class="fa fa-download"></span> 文件下载 </h2>
                    <div class="clear-1"></div>
                    <div class="content">
                        <div class="scroll-list-1">
                            <div id="carousel-example-generic-download" class="carousel slide" style="height:145px;">
                                <div class="carousel-inner" role="listbox">
                                    </li>
                                    </ul>
                                </div>
                                <div class="item">
                                    <ul class="inner-list-1">
                                        <li>
                                            <a href="">
                                                <i class="word-icon"></i>
                                                学生用户说明书V4.9.1.docx
                                            </a>
                                            <span id="date">2019-12-06</span>
                                        </li>
                                    </ul>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
                <div class="clearfix"></div>
            </div>
        </div>
        <div class="col-md-4">
            <div class="list-box-1" style="height:578px;">
                <h2 class="title" id="gonggao"><span class="fa fa-user"> </span>通知公告</h2>
                <div class="clear-1"></div>
                <div class="content">
                    <div class="scroll-list-1">
                        <div id="carousel-example-generic-3" class="carousel slide">
                            <div class="carousel-inner" role="listbox" style="height:520px;">
                                <div class="item active">
                                    <ul class="list-ul-2">
                                    </ul>
                                </div>
                                <div class="item ">
                                    <ul class="list-ul-2">
                                    </ul>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
                <div class="clearfix"></div>
            </div>
        </div>
    </div>
</body>
<div style="display:none">
    <div id="quickConfigDiv">
        <form id="indexForm" name="indexForm" action="/eams/saveMenus.action" method="post">

            <input type="hidden" name="quickMenu.id" value="">

        </form>
        <div class="ui-widget ui-widget-content ui-helper-clearfix ui-corner-all">
            <div class="portlet-content  grid">
            </div>
        </div>
    </div>
</div>
</html>

<div class="clear-3"></div>
</div>
<div id="footer">
    Copyright © 2018 上海树维信息科技有限公司
</div>






<script type="text/javascript">
    $.ajax({
        url:"/solr",
        data:"name=${sname}",
        dataType:"json",
        success:function (data) {
            /!*数据渲染添加上去*!/
            var html="";
            for(var i=0;i<data.length;i++){
                html+="<li class=\"caidan"+(i+1)+"\">"
                html+=" <a>"+data[i].s_name+"</a>"
                html+="<ul class=\"second-ul second-ul-right xiala"+(i+1)+"\" style=\"display: none\">"
                for(var n=0;n<data[i].twosolr.length;n++){
                    html+=" <li>"
                    html+="<a href=\"\" target=\"iframeMain\" onclick=\"return openUrl(this)\">"+data[i].twosolr[n].t_name+"</a>"
                    html+=" </li>"
                }
                html+="</ul>";
            }
            html+="</li>"
            $("#main-nav .top-nav").append($(html));

            $(".caidan1").hover(
                function () {
                    $(".xiala1").show();
                },
                function () {
                    $(".xiala1").hide();
                });
            $(".caidan2").hover(
                function () {
                    $(".xiala2").show();
                },
                function () {
                    $(".xiala2").hide();
                });
            $(".caidan3").hover(
                function () {
                    $(".xiala3").show();
                },
                function () {
                    $(".xiala3").hide();
                });
            $(".caidan4").hover(
                function () {
                    $(".xiala4").show();
                },
                function () {
                    $(".xiala4").hide();
                });

            $(".caidan1").click(function () {
                newsajax();
            })


        }
    })
    function newsajax() {
        var newshtml=""
        $.ajax({
            url:"/ajaxnews",
            data:null,
            dataType:"json",
            success:function (news) {
                newshtml+="<table>"
                newshtml+="<tr>"
                newshtml+="<input type='button' value='新增' id='addnews'>"
                newshtml+="<input type='text' id='cxtitle'><input type='button' value='查询' id='cxtitles'><br>"
                newshtml+="<td class='xwtr'>序号</td>"
                newshtml+="<td class='xwtr'>新闻标题</td>"
                newshtml+="<td class='xwtr'>新闻主题</td>"
                newshtml+="<td class='xwtr'>新闻发布时间</td>"
                newshtml+="<td class='xwtr'>删除</td>"
                newshtml+="<td class='xwtr'>修改</td>"
                newshtml+="</tr>"

                for (var i=0;i<news.length;i++){
                    newshtml+="<tr>"
                    newshtml+="<td class='xwtr'>"+news[i].n_id+"</td>"
                    newshtml+="<td class='xwtr'>"+news[i].title+"</td>"
                    newshtml+="<td class='xwtr'>"+news[i].n_body+"</td>"
                    newshtml+="<td class='xwtr'>"+news[i].time+"</td>"
                    newshtml+="<td class='del' class='xwtr'>删除</td>"
                    newshtml+="<td class='xg' class='xwtr'>修改</td>"
                    newshtml+="</tr>"
                }
                newshtml+="</table>"
                $("#main-content").html($(newshtml))
                $("#news").addClass("news");


                /*新增*/
                var flagadd=true;
                $("#addnews").click(function () {
                    if(flagadd){
                        var addnews="<div id='adddiv'>"
                        addnews+="新闻标题<input type='text' id='tit'><br>"
                        addnews+="新闻主题<textarea id='bob' rows='3' cols='20'></textarea><br>"
                        addnews+="<input type='button' value='提交' id='addn'>"
                        addnews+="</div>"
                        $("#main-content").append($(addnews));
                        $("#adddiv").addClass("addnews")
                        flagadd=false;
                        $("#addn").on("click",function () {
                            var tit=$("#tit").val();
                            var bob=$("#bob").val();

                            $.ajax({
                                url:"/addnews",
                                data:"title="+tit+"&body="+bob,
                                success:function (data) {
                                    if(data){
                                        alert("您新增成功了啊！！")
                                        $("#adddiv").remove();
                                        flagadd=true;

                                    }else{
                                        alert("您新增失败了!")
                                    }
                                }
                            })
                        })
                    }
                })

                /*删除*/
                $(".del").click(function () {
                    var flag= confirm("您确认要删除这条数据");
                    if (flag){
                        var n_id=$(this).parent().children(":first").text();
                        var wo=$(this).parent()
                        $.ajax({
                            url:"/sc",
                            data:"n_id="+n_id,
                            success:function (dele) {
                                if (dele){
                                    alert("已删除该行数据")
                                    wo.remove();
                                }
                            }

                        })
                    }

                })

                /*模糊查询*/
                $("#cxtitles").click(function () {
                    var cxhtml="";
                    var  xz=$("#cxtitle").val()
                    var fl=  $("#cxtitle").parent();
                    $.ajax({
                        url:"/mohu",
                        data:"titlecx="+xz,
                        dataType:"json",
                        success:function (deless) {
                            cxhtml+="<table>"
                            cxhtml+="<tr>"
                            cxhtml+="<input type='button' value='新增' id='addnews'><br>"
                            cxhtml+="<input type='text' id='cxtitle'><input type='button' value='查询' id='cxtitles'><br>"
                            cxhtml+="<td class='xwtr'>编号</td>"
                            cxhtml+="<td class='xwtr'>新闻标题</td>"
                            cxhtml+="<td class='xwtr'>新闻主题</td>"
                            cxhtml+="<td class='xwtr'>新闻发布时间</td>"
                            cxhtml+="<td class='xwtr'>修改新闻</td>"
                            cxhtml+="<td class='xwtr'>删除新闻</td>"
                            cxhtml+="</tr>"

                            for (var i=0;i<deless.length;i++){
                                cxhtml+="<tr>"
                                cxhtml+="<td class='xwtr'>"+deless[i].n_id+"</td>"
                                cxhtml+="<td class='xwtr'>"+deless[i].title+"</td>"
                                cxhtml+="<td class='xwtr'>"+deless[i].n_body+"</td>"
                                cxhtml+="<td class='xwtr'>"+deless[i].time+"</td>"
                                cxhtml+="<td class='xg' class='xwtr'>修改</td>"
                                cxhtml+="<td class='del' class='xwtr'>删除</td>"
                                cxhtml+="</tr>"
                            }
                            cxhtml+="</table>"
                            $("#main-content").html($(cxhtml))
                        }
                    })

                })
                /*修改*/
                var flagadd=true;
                $(".xg").click(function () {
                    if(flagadd){
                        var addnews="<div id='adddiv'>"
                        addnews+="新闻标题<input type='text' id='tit'><br>"
                        addnews+="新闻主题<textarea id='bob' rows='3' cols='20'></textarea><br>"
                        addnews+="<input type='button' value='提交' id='addn'>"
                        addnews+="</div>"
                        $("#main-content").append($(addnews));
                        $("#adddiv").addClass("addnews")
                        flagadd=false;
                        $("#addn").on("click",function () {
                            var tit=$("#tit").val();
                            var bob=$("#bob").val();

                            $.ajax({
                                url:"/xgnews",
                                data:"title="+tit+"&body="+bob,
                                success:function (data) {
                                    if(data){
                                        alert("您修改成功了啊！！")
                                        $("#adddiv").remove();
                                        flagadd=true;

                                    }else{
                                        alert("您修改失败了!")
                                    }
                                }
                            })
                        })
                    }
                })



            }
        })
    }
</script>
<script type="text/javascript">
    $("#tui").click(function () {
        alert("您已经退出登录！")
        location.href="/exit"
    })

    var timer;
    function resizeIframe() {
        if(timer) {
            clearInterval(timer);
        }

        timer = setInterval(danymicfix, 500);
    }

</script>
</body>
</html>

